<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath%>">
	<title>添加影厅</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="keywords" content="" />
	<script type="application/x-javascript">
		//绑定事件，将页面平滑到指定窗口(初始化加载页面)
		addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
		function hideURLbar(){ window.scrollTo(0,1); } 
	</script>
	<link rel="stylesheet" href="./layui/layuicss/layui.css" media="all">
	<link href="./css/newadd.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="home/css/reset.css">
	<link rel="stylesheet" type="text/css" href="home/css/fonts.css">
	<link rel="stylesheet" type="text/css" href="home/css/home.css">
	<link rel="stylesheet" type="text/css" href="home/css/movies.css">
	<link rel="stylesheet" type="text/css" href="home/css/window.css">

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo"><em>最接地气剧院票务管理系统</em></div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a onclick="alert('如有问题，你可以发送邮件至 18829491124@163.com')">联系我们</a></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="./img/login.jpg" class="layui-nav-img">
          最接地气小组
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="./index.html">退了</a></li>
    </ul>
  </div>
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item">
          <a class="" href="javascript:;">管理演出厅</a>
          <dl class="layui-nav-child">
            <dd><a href="studio.jsp">编辑演出厅</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">管理座位</a>
          <dl class="layui-nav-child">
            <dd><a href="seat.html">查找/删除座位</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">管理人员</a>
          <dl class="layui-nav-child">
            <dd><a href="user.html">查看/删除用户</a></dd>
          </dl>
        </li>
      </ul>
    </div>
  </div>

		<div id="page-wrapper" class="pa-wrp">			
			<div class="grap">
				<ol class="breadcrumb bg-head">	   
				    <li><a href="home/theatre.jsp">返回影厅列表</a></li>
				    <li class="active">影厅添加</li>
				</ol>
				<div class="form-wrap">
					<form action="Theatre?method=add" method="post" accept-charset="utf-8" role="form" class="from-horizontal" id="addtheatre" name="myform">
						<div class="row">
							<div class="col-sm-6">
							<div class="form-group">
								    <label for="addname">影厅名称:</label>
								    <input type="text" class="form-c inpbg" id="tname" name="tname" 
							        placeholder="请输入影厅名称" >    
							</div>
							<div class="form-group">
								    <label for="addrow">座位行数:</label>
								    <input type="text" class="form-c inpbg" id="trowcount" name="trowcount" 
							        placeholder="请输入影厅座位行数" >    
							</div>
							<div class="form-group">
								    <label for="addcol" style = "">座位列数:</label>
								    <input type="text" class="form-c inpbg" id="tcolcount" name="tcolcount" 
							        placeholder="请输入影厅座位列数" >    
							</div>
							<div class="form-group">
								    <label for="addintroduct">影厅简介:</label>
								   <!--
								    <input type="text" class="form-c inpbg" id="tintroduction" name="tintroduction" 
							        placeholder="请输入影厅简介" >   
							       -->
							        <textarea class="form-c inpbg" id="tintroduction" name="tintroduction"
							         	style="width:200px;height:50px;" placeholder="请输入影厅简介"></textarea>
							</div>		
							</div>
							<div class="col-sm-12">
								<div class="form-group">
								    <label for="addimgfile">请选择要上传的影厅照片</label>
								    <input type="file" id="timgfile" name="timgfile" >    
								</div>	
								<div class="imgdivstu">
									<img src="" id="timg" name="timg" > 
								</div>
							</div>
						</div>
						<button type="submit" class="btn btn-primary add-sub" >提交</button>  
								    <button type="reset" class="btn btn-default bg-color">重置</button>
					</form>					
				</div>					
			</div>
		</div>
	</div>
	
	<script src="home/js/jquery-1.12.0.min.js"></script>
	<script src="home/js/addTheatre.js"></script>
	<script src="home/js/bootstrap.min.js" ></script>
	<script src="home/js/window.js" ></script>
	<script type="text/javascript">
	function isPic()
	{
	    var pic=myform.timgfile.value;
	    var ext=pic.substring(pic.lastIndexOf(".")+1);
	    //可以再添加允许类型
	    if(ext.toLowerCase()=="jpg" || ext.toLowerCase()=="png" || ext.toLowerCase()=="gif" || pic==""){
	        return true;
	    }
	    else
	    {
	    	win.alert("图片类型错误","只能上传jpg、png、gif图像!");
	    	myform.timgfile.value="";
	        return false;
	    }
	}
	
	// 图片响应
	$("input[type=file]").change(function(e){
		if(isPic()){
			var fileName="";
			if(typeof(fileName) != "undefined") {			
				fileName = $(this).val().split("\\").pop();  
		        fileName=fileName.substring(0, fileName.length);
			}
			fileName = "home/img/studio/" + fileName;
			$("#timg")[0].src=fileName;
		}
	})
	</script>
</body>
</html>